﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using KC.DTO.Core;
using KC.Enums.WorkFlow;

namespace KC.Service.DTO.WorkFlow
{
    [Serializable]
    [DataContract(IsReference = true)]
    public class ApproveDataDto : EntityBaseDTO
    {
        [DataMember]
        public int Id { get; set; }
        [DataMember]
        [Display(Name = "所属应用ID")]
        public Guid ApplicationId { get; set; }
        [DataMember]
        [Display(Name = "所属应用")]
        public string ApplicationName { get; set; }
        [DataMember]
        [Display(Name = "所属类别ID")]
        public int? FlowTypeId { get; set; }
        [DataMember]
        [Display(Name = "所属类别")]
        public string FlowTypeName { get; set; }
        [DataMember]
        [Display(Name = "流程名称")]
        public string FlowName { get; set; }
        [DataMember]
        [Display(Name = "单据名称")]
        public string WorkName { get; set; }
        [DataMember]
        [Display(Name = "单据编号")]
        public string WorkCode { get; set; }
        [DataMember]
        [Display(Name = "单据ID")]
        public string Workid { get; set; }
        [DataMember]
        [Display(Name = "流程ID")]
        public int FlowId { get; set; }
        [DataMember]
        [Display(Name = "发起人")]
        public string AppUserCap { get; set; }
        [DataMember]
        [Display(Name = "发起时间")]
        public DateTime OrigAppTime { get; set; }
        [DataMember]
        [Display(Name = "发起时间")]
        public string OrigTime {
            get
            {
                return OrigAppTime.AddHours(8).ToString("yyyy-MM-dd HH:mm:ss");
            } 
        }
        [DataMember]
        [Display(Name = "最近审批时间")]
        public DateTime? LastAppTime { get; set; }
        [DataMember]
        [Display(Name = "最近审批时间")]
        public string LastTime
        {
            get
            {
                return LastAppTime == null ? "" : LastAppTime.Value.AddHours(8).ToString("yyyy-MM-dd HH:mm:ss");
            }
        }
        [DataMember]
        [Display(Name = "催审时间")]
        public DateTime? ReminderTime { get; set; }
        [DataMember]
        [Display(Name = "催审时间")]
        public string RemindTime
        {
            get
            {
                return ReminderTime == null ? "" : ReminderTime.Value.AddHours(8).ToString("yyyy-MM-dd HH:ss:mm");
            }
        }
        [DataMember]
        [Display(Name = "数据查看URL")]
        public string DataViewUrl { get; set; }

        [DataMember]
        public ProcessingState ProcessingState { get; set; }

        [DataMember]
        public string ProcessingStateString { get; set; }

        public string ApprovedPersonnel { get; set; }
        public string  UnapprovedPersonnel { get; set; }

        public string BusiTypeString { get; set; }

        public bool IsApproved { get; set; }
       
    }
}
